package com.frkj.order.controller;

import com.frkj.order.cache.BusinessCache;
import com.frkj.order.cache.LoginOperatorCache;
import com.frkj.order.model.Business;
import com.frkj.order.model.LoginOperator;
import com.frkj.order.model.UserOrder;
import com.frkj.order.vo.QueueCount;
import com.jfinal.core.Controller;

import java.util.List;

/**
 * Create-Date: 2016/7/5
 * Description:
 */
public class DemoController extends Controller {

    /**
     * 用户
     */
    public void user() {
        List<Business> businessList = BusinessCache.getBusinessList();
        setAttr("businessList", businessList);
        render("user.html");
    }

    /**
     * 显示屏
     */
    public void screen() {
        List<QueueCount> queueCountList = UserOrder.me.getWaitingQueueInfoList(-1);
        setAttr("queueCountList", queueCountList);

        List<UserOrder> userOrderList = UserOrder.me.getWaitingUserList(20);
        setAttr("userOrderList", userOrderList);

        render("screen.html");
    }

    /**
     * 办事柜台
     */
    public void operator() {
        List<LoginOperator> loginOperatorList = LoginOperatorCache.getLoginOperatorList();
        setAttr("loginOperatorList", loginOperatorList);
        render("operator.html");
    }
}
